;--------------------------------------
;
; strlen.asm
;
; determine lenth of string
;

;--------------------------------------
;
; include defs, prototypes and macros
;

include tab6.inc

;--------------------------------------
;
; begin code segment
;

	.CODE

;--------------------------------------
;
; strlen(char *srce);
;
; 

strlen	PROC PASCAL PUBLIC USES DS ES DI SI,srce:PBYTE

 IF mdl eq 3

        lds     si,srce

  ELSE

        mov     si,srce

  ENDIF

	sub	ax,ax
	sub	cx,cx

  .REPEAT
	mov	al,BYTE PTR ds:[si]
	.BREAK .IF (al==0)
	inc	si
	inc	cx

  .UNTIL (cx==0)
	mov	ax,cx
	mov	ds:string_length,ax	
	ret	                       ; return to caller

strlen	ENDP

;
;--------------------------------------

	END

;
;--------------------------------------


